package com.vnhai.java.jsf.managedbean;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.vnhai.java.jsf.bus.UserBUS;
import com.vnhai.java.jsf.pojo.User;

@Component
@ManagedBean
@SessionScoped
public class UserManagedBean {

	@Autowired
	private UserBUS userBUS;
	private List<User> listUser;

	public List<User> getListUser() {
		listUser = new ArrayList<User>();
		for (int i = 0; i < 20; i++) {
			listUser.add(new User(1, 275635361, "Hai", "Vu", "Ngoc",
					"135 Tran Hung Dao", 98546352, null));
		}
		return listUser;
	}

	public void setUserBUS(UserBUS userBUS) {
		this.userBUS = userBUS;
	}

	public String sayHello() {
		return userBUS.sayHello();
	}
}
